package com.zhuang.designpattern.observer;

import com.zhuang.designpattern.observer.event.listener.MinibusTargetService;

import java.util.Date;

/**
 * description: LotteryServiceImpl
 * date: 2022/9/20 16:49
 * author: Zhuang
 * version: 1.0
 */
public class LotteryServiceImpl extends LotteryService{

    private final MinibusTargetService minibusTargetService = new MinibusTargetService();

    @Override
    protected LotteryResult doDraw(String uId) {
        // 摇号
        String lottery = minibusTargetService.lottery(uId);
        // 结果
        return new LotteryResult(uId, lottery, new Date());
    }
}
